﻿Imports System.Drawing

Namespace SRAGWM
    Public Class LegendEntry

        Dim _SymbologyStyle As Integer
        Dim _SymbologyWeight As Integer
        Dim _FillColor As Color
        Dim _BorderColor As Color
        Dim _Filter As Filter
        Dim _DataSource As DataSource
        Dim _Tooltip As String

        Property SymbologyStyle() As Integer
            Get
                Return _SymbologyStyle
            End Get
            Set(ByVal value As Integer)
                _SymbologyStyle = value
            End Set
        End Property

        Property SymbologyWeight() As Integer
            Get
                Return _SymbologyWeight
            End Get
            Set(ByVal value As Integer)
                _SymbologyWeight = value
            End Set
        End Property

        Property FillColor() As Color
            Get
                Return _FillColor
            End Get
            Set(ByVal value As Color)
                _FillColor = value
            End Set
        End Property

        Property BorderColor() As Color
            Get
                Return _BorderColor
            End Get
            Set(ByVal value As Color)
                _BorderColor = value
            End Set
        End Property

        Property Filter() As Filter
            Get
                Return _Filter
            End Get
            Set(ByVal value As Filter)
                _Filter = value
            End Set
        End Property

        Property DataSource() As DataSource
            Get
                Return _DataSource
            End Get
            Set(ByVal value As DataSource)
                _DataSource = value
            End Set
        End Property

        Property Tooltip() As String
            Get
                Return _Tooltip
            End Get
            Set(ByVal value As String)
                _Tooltip = value
            End Set
        End Property

        Public Sub New(ByVal pSymbologyStyle As Integer, ByVal pSymbologyWeight As Integer, _
                              ByVal pBorderColor As Color, ByVal pFillColor As Color, ByVal pTooltip As String)

            _SymbologyStyle = pSymbologyStyle
            _SymbologyWeight = pSymbologyWeight
            _BorderColor = pBorderColor
            _FillColor = pFillColor
            _Tooltip = pTooltip

        End Sub

        Sub SetDataSource(ByVal pDBName As String, ByVal pDB As String, ByVal pTable As String, _
                          ByVal pAtributes() As Object)

            Dim DS As New SRAGWM.DataSource(pDBName, pDB, pTable, pAtributes)

            _DataSource = DS

        End Sub

        Sub SetFilter(ByVal pWhereClause As String, ByVal pPoints() As Object, ByVal pNumPairs As Double, _
                          ByVal pSpatialOperator As Integer)

            Dim F As New SRAGWM.Filter(pWhereClause, pPoints, pNumPairs, pSpatialOperator)

            _Filter = F

        End Sub
    End Class
End Namespace
